ds_queue_enqueue

Adds the given value (or values) into the given queue.

语法:

ds_queue_enqueue(id, val [, val2, ... val15]);


参数 描述
id The id of the queue to add to.
val The value to add to the queue.
[val2, ... val15] Optional values to be added to the queue.


返回: N/A(无返回值)


描述

This function will add a value (real or string) onto the tail of the ds_queue. The function can take a further 14 optional arguments (making a total of 15 possible additions), permitting you to add multiple values consecutively to the tail of the queue in a single call.


例如:

move_queue = ds_queue_create();
ds_queue_enqueue(move_queue, x + 200);
ds_queue_enqueue(move_queue, y);
ds_queue_enqueue(move_queue, x + 200);
ds_queue_enqueue(move_queue, y + 200);
ds_queue_enqueue(move_queue, x);
ds_queue_enqueue(move_queue, y + 200);
ds_queue_enqueue(move_queue, x);
ds_queue_enqueue(move_queue, y);

The above code creates a new ds_queue and stores its index in the variable "move_queue". It then pushes a number of values onto the queue for future use.


上一页: Queues
下一页: ds_queue_dequeue
© Copyright YoYo Games Ltd. 2018 All Rights Reserved